<%= form_for @domain, :url => (@domain.new_record? ? domains_path : domain_path(:id => @domain)) do |f| %>
  <%= base_errors_for @domain %>
  <ul class="nav nav-tabs" data-tabs="tabs">
    <li class="active"><a href="#primary" data-toggle="tab"><%= _("Domain") %></a></li>
    <% if authorizer.can?(:view_params) %>
      <li><a href="#params" data-toggle="tab"><%= _("Parameters") %></a></li>
    <% end %>
    <% if show_location_tab? %>
      <li><a href="#locations" data-toggle="tab"><%= _("Locations") %></a></li>
    <% end %>
    <% if show_organization_tab? %>
      <li><a href="#organizations" data-toggle="tab"><%= _("Organizations") %></a></li>
    <% end %>
  </ul>

  <div class="tab-content">

    <div class="tab-pane active" id="primary">
      <%= text_f   f, :name, :label => _("DNS Domain"), :help_inline => _("The full DNS domain name") %>
      <%= text_f   f, :fullname, :help_inline => _("Full name describing the domain") %>
      <%= smart_proxy_fields f %>
    </div>
    <% if authorizer.can?("view_params") %>
      <div class="tab-pane" id="params">
        <%= render "common_parameters/parameters", { :f => f, :type => :domain_parameters } %>
      </div>
    <% end %>
    <%= render 'taxonomies/loc_org_tabs', :f => f, :obj => @domain %>

  </div>

  <%= submit_or_cancel f %>
<% end %>
